﻿#include "myplaintextedit.h"
#include <QMouseEvent>

MyPlainTextEdit::MyPlainTextEdit(QWidget *parent) : QPlainTextEdit(parent)
{

}

MyPlainTextEdit::~MyPlainTextEdit()
{

}

void MyPlainTextEdit::mousePressEvent(QMouseEvent *e)
{
    if(isReadOnly()){
        e->ignore();
    }else{
        QPlainTextEdit::mousePressEvent(e);
    }
}

void MyPlainTextEdit::mouseDoubleClickEvent(QMouseEvent *e)
{
    if(isReadOnly()){
        e->ignore();
    }else{
        QPlainTextEdit::mousePressEvent(e);
    }
}
